package com.Home
{
	import com.*;
	import com.Engine.*;
	import com.Packet.*;
	import com.UI.*;
	
	import flash.display.*;
	import flash.events.*;
	import flash.external.*;
	import flash.filters.*;
	import flash.geom.*;
	import flash.system.*;
	import flash.text.*;
	import flash.ui.*;
	import flash.utils.*;
	
	import org.aswing.*;
	import org.aswing.border.*;
	import org.aswing.border.EmptyBorder;
	import org.aswing.colorchooser.*;
	import org.aswing.dnd.*;
	import org.aswing.event.*;
	import org.aswing.ext.*;
	import org.aswing.geom.*;
	import org.aswing.tree.AbstractLayoutCache;
	public class FrameHomeBuilding1Slave extends FrameHomeBuilding
	{
		public function FrameHomeBuilding1Slave()
		{
		}
		override public function setImages():void
		{
			super.setImages();
			var img_char_background:DisplayObject = Client.getUIElement("img_home_bg_1") as DisplayObject
			setBackgroundDecorator(new AssetBackground(img_char_background));
			setSize(new IntDimension(img_char_background.width, img_char_background.height));
			setPreferredSize(new IntDimension(img_char_background.width, img_char_background.height));
			setSizeWH(img_char_background.width,img_char_background.height);
			setLocationXY((Engine.W - img_char_background.width) / 2,(Engine.H - img_char_background.height)/2);
			
			btn_dispatch.addActionListener(function():void{FrameHomeDispatch.show(objDest,_frame);});
			btn_accelerate.addActionListener(function():void{FrameHomeAccelerate.show(_frame);});
		}
		public static var _frame:FrameHomeBuilding1Slave = null;
		public static function show(obj:ObjectHomeBuilding):void
		{
			if(_frame == null)
			{
				_frame = new FrameHomeBuilding1Slave();
				PanelMainHelp.getInstance().addChild(_frame);
			}
			if(!isShowing())
			{
				_frame.show();
				_frame.setLocationXY((Engine.W - _frame.width) / 2,(Engine.H - _frame.height)/2);
				PanelMainHelp.getInstance().bringToTop(_frame);
			}
			_frame.update(obj);
		}
		public static function hide():void
		{
			if(isShowing())_frame.hide();
		}
		public static function isShowing():Boolean
		{
			return(_frame != null&& _frame.isShowing());
		}
	}
}